package leecode.q0301;

import java.util.ArrayList;
import java.util.List;

class TripleInOne {

    List<Integer> list;
    int defaultSize;
    int cur0;
    int cur1;
    int cur2;

    public TripleInOne(int stackSize) {
        defaultSize = stackSize;
        list = new ArrayList<>(stackSize * 3);
        cur0 = 0;
        cur1 = stackSize;
        cur2 = stackSize * 2;
    }

    public void push(int stackNum, int value) {
        switch (stackNum) {
            case 0:
                if (cur0 >= defaultSize) {
                    break;
                }
                list.add(cur0++);
                break;
            case 1:
                if (cur1 >= defaultSize * 2) {
                    break;
                }
                list.add(cur1++);
                break;
            case 2:
                if (cur2 >= defaultSize * 3) {
                    break;
                }
                list.add(cur2++);
                break;
            default:
                break;
        }
    }

//    public int pop(int stackNum) {
//        switch ()
//    }
//
//    public int peek(int stackNum) {
//
//    }
//
//    public boolean isEmpty(int stackNum) {
//
//    }
}

/**
 * Your TripleInOne object will be instantiated and called as such:
 * TripleInOne obj = new TripleInOne(stackSize);
 * obj.push(stackNum,value);
 * int param_2 = obj.pop(stackNum);
 * int param_3 = obj.peek(stackNum);
 * boolean param_4 = obj.isEmpty(stackNum);
 */
